package com.wp.www.controller;

import com.wp.www.entity.CommonResult;
import com.wp.www.entity.order.Order;
import com.wp.www.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/order")
    public CommonResult<Order> creatOrder(@RequestBody Order order){
        orderService.createOrder(order);
        return new CommonResult(200,"订单创建成功",order);
    }
}
